let app = getApp()
Component({
    properties: {
           order_type:Number
      },
      data:{
        page_path: "pages/pay-result/pay-result",
        desc: "",
        visible: !1,
        show: !1,
        animation: !0,
        orderId: "",
        serviceId: "",
        storedId: "",
        payGiftInfo: {},
        payMoney: "",
        groupUrl: !1,
        moneySign:'¥'
      },
    lifetimes: {
        attached: function () {
          var that=this
          that.setData({
            siteDomain:app.globalData.siteDomain
          })
          wx.request({
            url: app.globalData.siteroot,
            data: {
              do:'Giftpay_getGiftpay',
              order_id:wx.getStorageSync('order_id'),
              user_id:wx.getStorageSync('user_id')
            },
            success: function(res) {
              if(res.data.data.is_use==1){
                that.setData({
                  visible:true,
                  show:true,
                  animation:false
                })
              }
              that.setData({
                payGiftInfo:res.data.data.coupon,
                payMoney:res.data.data.pay_money,
                is_use:res.data.data.is_use,
                gift_pay_id:res.data.data.gift_pay_id
              })
            }
          })
       }
      },
    methods: {
      hidePayPacket:function(){
        this.setData({
            visible:false
        })
      },
      handlerUseCoupon:function(){
        wx.reLaunch({
          url: '/yb_shopv2/entry/video-market/index',
        })
      },
      backhome:function(){
        wx.reLaunch({
          url: '/yb_shopv2/entry/video-market/index',
        })
      },
      lookorder:function(){
        if(this.data.order_type==100){
          wx.navigateTo({ 
            url: '/yb_shopv2/native/all/index?type=services_order_list&pagetitle=我的预约&page_type=5'
          })
        }else{
          wx.navigateTo({
            url: '/yb_shopv2/native/all/index?type=mine_order&orderStatusCur=-1',
           })
        }
      }
    }
});
